﻿<?php
if($this->actu['p_admin']) $action = $this->baseUrl() .'/admin/ventes/update-ventes-user';
else $action = $this->baseUrl() .'/admin/ventes/save-ventes-user';
?>
<form class="form-horizontal" name="frm" action="<?php echo $action ?>" method="post" enctype="multipart/form-data">
<div align="center" style="width:400px"><h3><?php echo $this->title ?></h3></div>
<div id="frm1">
	<div class="control-group">				
		<label class="control-label">Nom :</label>
		<div class="controls">
			<input name="nom" type="text" value="<?php echo htmlspecialchars(stripslashes($this->actu['titre'])) ?>" style="width:350px" placeholder="Nom"/>
		</div>
	</div>
	<div class="control-group">				
		<label class="control-label">Prénom :</label>
		<div class="controls">
			<input name="prenom" type="text" value="<?php echo htmlspecialchars(stripslashes($this->actu['titre'])) ?>" style="width:350px" placeholder="Prénom"/>
		</div>
	</div>
	<div class="control-group">				
		<label class="control-label">UserID :</label>
		<div class="controls">
			<input name="userid" type="text" value="<?php echo htmlspecialchars(stripslashes($this->actu['titre'])) ?>" style="width:350px" placeholder="UserID"/>
		</div>
	</div>
	<div class="control-group">				
		<label class="control-label">Mot de passe :</label>
		<div class="controls">
			<input name="password" type="password" value="<?php echo htmlspecialchars(stripslashes($this->actu['titre'])) ?>" style="width:350px" placeholder="Password"/>
		</div>
	</div>
	<div class="control-group">				
		<label class="control-label">E-mail :</label>
		<div class="controls">
			<input name="email" type="text" value="<?php echo htmlspecialchars(stripslashes($this->actu['titre'])) ?>" style="width:350px" placeholder="E-mail"/>
		</div>
	</div>
	<div class="control-group">				
		<label class="control-label">Limiter aux ventes :</label>
		<div class="controls">
		 <?php
		$ventesModel = new Admin_Model_Ventes();
		$rows = $ventesModel->getVentesByDtdeleted();
		foreach($rows as $row) {
			$date= new DateTime($row['dtvente']);
			$dtvente = $date->format('d/m/Y');
			echo '<input type="checkbox" name="limited[]" value="' .$row['p_ventes'] .'" class="chk"> '. $dtvente .' - '. stripslashes($row['titre']) ."<br>\n";
		}
		?>

		</div>
	</div>
</div>
	
<div class="" align="center" style="width:500px">
	<ul class="inline">
		<li style="display:block">
			<a href="<?php echo $this->baseUrl() ?>/admin/article"><input class="btn btn-primary" type="button" name="cancel" value="annulé"></a> &nbsp;	
			<input type="hidden" name="p_actu" value="<?php echo $this->actu['p_actu']?>">
            <input type="hidden" name="num_ventes" value="<?php echo $this->num_ventes?>">
			<input class="btn btn-primary" type="submit" name="btnAdd" value=" Sauver ">
		</li>
	</ul>
</div>
</form>